import {
	EditView3ActionType,
	IEditView3Ability,
	IEditView3ControllerParams,
	IEditView3Model,
	IEditView3Store,
	IParam,
	IViewEvent,
} from '@/core';
import { QXEvent } from 'qx-util';
import {
	getViewClassNames,
	useViewAction,
	useViewBasic,
	useViewControllerParams,
	useViewProps,
} from '../use-view';

/**
 * 获取编辑视图3输入参数
 *
 * @export
 * @return {*}
 */
export function useEditView3Props() {
	return {
		...useViewProps(),
	};
}

/**
 * 获取编辑视图3基础
 *
 * @export
 * @param {IEditView3Model} model 编辑视图3模型
 * @param {IParam} props 输入参数
 * @return {*}
 */
export function useEditView3Basic(model: IEditView3Model,props: IParam) {
	const getClassNames = (props:IParam) =>{
		return getViewClassNames(model, props)
	}
	return {
		...useViewBasic(model,props),
		getClassNames,
	};
}

/**
 * 编辑视图3行为
 *
 * @export
 */
export function useEditView3Action(controller: any) {
	return {
		...useViewAction(controller),
	};
}

/**
 * 获取编辑视图3控制器输入参数
 *
 * @export
 * @param {IEditView3Model} model
 * @param {IParam} props
 * @param {QXEvent<IViewEvent<EditView3ActionType, IEditView3Ability>>} evt
 * @return {*}  {IEditView3ControllerParams<EditView3ActionType, IEditView3Ability>}
 */
export function useEditView3ControllerParams(
	model: IEditView3Model,
	props: IParam,
	evt: QXEvent<IViewEvent<EditView3ActionType, IEditView3Ability>>
): IEditView3ControllerParams<EditView3ActionType, IEditView3Ability> {
	return {
		...useViewControllerParams<IEditView3Store, IEditView3Model>(
			model,
			props,
			evt
		),
	};
}
